<?php
/*
	检查序列号是否合法
*/
defined('BY_JYA') or exit('error');
list($seri_num)=$arguments;
if(strlen($seri_num)!=20){
	return false;
}
$code=substr($seri_num,0,6);
$code=intval($code);
if(!$code){
	return false;
}
$create_card=pdo_get('jy_move_card_create',array('uniacid'=>$_SESSION['uniacid'],'code'=>$code),array('status','seckey'));

if(!$create_card || !$create_card['status']){
	return false;
}
$temp=substr($seri_num,0,15);
$sign=cfc('tools')->create_check_code($temp,$create_card['seckey'],5);
if(substr($sign,0,5)!=substr($seri_num,15)){
	return false;
}
return true;